#include <cstdio>

#include "messageheader.h"
#include "HTTPresponse.h"
#include "HTTPclientconection.h"
#include "httputil.h"

int main()
{
    using HTTPUtil::HTTPMethod;
    HTTPClientConnection con;
    MessageHeader headers;
    con.setHost("www.baidu.com");
    con.connect();
    HTTPResponse resp = con.request(HTTPUtil::MethodGET, headers, "/");
    if (resp.isSuccess()) {
        printf("%s\n", resp.getResponseBytes().c_str());
    }
    else {
        printf("error, request failed\n");
    }
    return 0;
}
